import * as type from './mutations-types'

export default { // 异步操作
  [type.AUPDATEINFO](context) {
    setTimeout(() => context.commit(type.UPDATEINFO), 1000);
  },
  [type.ADDITIONAL](context, num) {
    console.log('我是 ', num);
    // setTimeout(() => {
    //   context.commit(type.ADDITIONAL, payload.payload);
    //   payload.success();
    // }, 1000);

    return new Promise(resolve => {
      context.commit(type.ADDITIONAL, num);
      resolve();
    });
  }
};
